package com.digitalchina.lxnsy.api;

import android.app.Activity;
import android.os.Handler;

import com.digitalchina.lxnsy.constant.MSG;
import com.digitalchina.lxnsy.constant.URL;
import com.digitalchina.lxnsy.toolkit.OkHttpUtil;
import com.digitalchina.lxnsy.xml.UserXML;
import com.lzy.okhttputils.model.HttpParams;

/**
 * ================================================
 * 项目名称：BigData
 * 类描述：
 * 包名：com.digitalchina.bigdata.api
 * 创建人：郑皓
 * 创建时间：2017/7/21 16:01
 * 修改备注：
 * ================================================
 */
public class BusinessAuthentication {

    /**
     * @param activity
     * @param expertName       真实姓名
     * @param expertTitleId    专家职称id
     * @param expertTitleNum   专家职称号
     * @param expertTitleImage 专家职称照片
     * @param idCardNum        身份证号
     * @param idCardImage      身份证照片
     * @param handler
     */
    public static void saveAuthenticationInfo(Activity activity, String expertName, String expertTitleId, String expertTitleNum, String expertTitleImage, String idCardNum, String idCardImage, Handler handler) {

        HttpParams params = new HttpParams();
        params.put("expertId", UserXML.getUserId(activity));
        params.put("expertName", expertName);
        params.put("expertTitleId", expertTitleId);
        params.put("expertTitleNum", expertTitleNum);
        params.put("expertTitleImage", expertTitleImage);
        params.put("idCardNum", idCardNum);
        params.put("idCardImage", idCardImage);

        OkHttpUtil.post(activity, URL.URL_SAVE_AUTHENTICATION_INFO, "", params, handler,
                MSG.MSG_SAVE_AUTHENTICATION_INFO_SUCCESS, MSG.MSG_SAVE_AUTHENTICATION_INFO_FIELD);
    }


    /**
     * 审核意见
     *
     * @param activity 返回参数  isAudit 0 审核未通过  1 审核通过  2 待审核  3 已注册 未提交
     *                 auditOpinion 审核意见
     *                 isChangeAudit 0 审核未通过  1 审核通过  2 待审核  3 未修改
     */
    public static void getAuditStatus(Activity activity, Handler handler) {

        HttpParams params = new HttpParams();
        params.put("expertId", UserXML.getUserId(activity));

        OkHttpUtil.post(activity, URL.URL_GET_AUDIT_STATUS, "", params, handler,
                MSG.MSG_GET_AUDIT_STATUS_SUCCESS, MSG.MSG_GET_AUDIT_STATUS_FIELD);
    }
}
